﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Home_BookDetail : System.Web.UI.Page
{
    public List<PlatformEntity> listPlatform { get; set; }
    public BookAdapter adapter;
    public LanguageManage Language;
    private UserEntity currentUser;
    public long bookID;
    public string deletecf = "";
    public BookEntity currentBook = new BookEntity();
    protected void Page_Load(object sender, EventArgs e)
    {
        //Check login
        currentUser = UserManager.Instance.Getuser();
        if (!currentUser.isLogin)
            Response.Redirect("~/Login.aspx");

        Language = new LanguageManage();
        currentBook = new BookEntity();
        if (Request.QueryString["bookid"] != null)
        {
            bookID = Convert.ToInt32(Request.QueryString["bookid"]);
            currentBook = adapter.getBook(bookID)[0];
            deletecf = Language["msgdeletebook"];
        }
    }
    public string ConvertActive(bool active)
    {
        try
        {
            if (active)
            {
                return "YES";
            }
            else
            {
                return "NO";
            }
        }
        catch (Exception)
        {

            return "NO";
        }
    }
}